home *** CD-ROM | disk | FTP | other *** search
/ ToolBook 3.0 / ToolBook v3.0.iso / tb30 / samples / library.tbk (.txt) < prev    next >
Encoding:
Asymetrix ToolBook File  |  1994-05-19  |  159.0 KB  |  2,764 lines

  1. itemOffset()
  2. origPage
  3. original
  4. itemOffset()
  5. label
  6. itemOffset()G
  7. A fast way to find the offset of an item in a list.  For example, itemOffset("e","a,b,c,d,e,f,g") would return "5"
  8. Handlers:    itemOffset (<item>,<list>)
  9. Parameters:
  10. <item>:      The item whose offset you are looking for.
  11. <list>:       The list in which you are looking.
  12. Note: to find out if the item is in the list, check if itemOffset is greater than 0.....
  13. -- finds the offset of an item in a list. 
  14. to get itemOffset itm,lst
  15.     step i from 1 to itemcount(lst)
  16.         pop lst
  17.         if itm = it
  18.             return i
  19.         end
  20.     return 0
  21. enddddddddddddddturn 0
  22. Display 2-D array values
  23. request2Darray
  24. request2Darray x[][]
  25. Zretval
  26. dimensions(x)
  27. x[i][j] 
  28. origPage
  29. original
  30. Display 2-D array values
  31. label
  32. Display 2-D array values
  33. Often, when debugging a script using arrays, you may want to display the array at a certain point in your script.  This page has a handler for displaying the contents of two-dimensional arrays. 
  34. Note that this also displays a standard method for walking through a 2D array.
  35. The button to the right fills an array with the elements of the list in the field.
  36. Once filled, it passes the array to the request2Darray handler (in this page script), which displays the contents of the array..ray.
  37. arrayField
  38. d,4,4/1/06
  39. h,7,4/1/23
  40. j,5,3/1/29
  41. i,1,1/9/55
  42. g,6,7/7/64
  43. e,9,11/13/66
  44. f,0,7/4/76
  45. b,3,5/23/91
  46. c,2,3/11/92
  47. a,8,1/12/933
  48. Display
  49. krequest2DArray
  50. arrayField
  51. buttonClick
  52. buttonClick
  53. Zx[][]
  54.     fill x 
  55. "arrayField" 
  56. ] order
  57. request2DArray x
  58. Display
  59. Add number of days to date
  60. Add number of days to date
  61. This handler adds a specified number of days to a provided date. Note that a negative number of days can be supplied to subtract a number of days.
  62. Handler:    newDate (<original date>,<days to add>)
  63. Parameters:
  64. <original date>:    Base date to which you want to add days
  65. <days to add>:    Number of days you want to add to <original date>
  66. Returns the modified date.
  67. -- function: newDate(<original date>,<number of days to add>)
  68. -- Returns a date n days from a given date.  Pass it a date 
  69. -- for the first parameter, followed by an integer (positive 
  70. -- or negative) representing the number of days from that date
  71. -- Example:  to find out the date 10 days ago
  72. -- set x to newDate(sysdate,-10)
  73. to get newDate origdate, days
  74.     format date origdate as "seconds"
  75.     increment origdate by (days*24*60*60)
  76.     format date origdate as sysdateformat from "seconds"
  77.     return origdate
  78. endddddddddddddddddddddddddddddddddddddddddd
  79. origPage
  80. original
  81. Add number of days to date
  82. label
  83. description only
  84. description and example
  85. topicName
  86. description and script
  87. Untitled
  88. enterpage
  89. pageName
  90. templateButtons
  91. label
  92. subtopicname
  93. topicName
  94. chosen
  95. cancel
  96. keychar
  97. cancel
  98. -- initialize dialog box
  99. "Untitled" 
  100. "topicName"
  101. B"description 
  102. buttonclick 
  103. -- sent 
  104. user presses OK
  105. pageName 
  106. chosen 
  107. "templateButtons"
  108.         -- 
  109. the specified 
  110. label 
  111. "subtopicname" 
  112.     close 
  113. -- handles OK 
  114. escape 
  115. keyEnter
  116. origPage
  117. original
  118. label
  119. in,false
  120. ThreeDeeRect
  121. bottomLine
  122. topLine
  123. Topic name:
  124. bottomLine
  125. topLine
  126. topicName
  127. Untitled Objects
  128. templateButtons
  129. chosen
  130. templates
  131. buttonclick
  132. buttonclick
  133.     -- store selected 
  134. a property 
  135. chosen
  136. "templates"
  137. Description and Script
  138. chosen
  139. Description and Script
  140. Description and &Script
  141. Description Only
  142. Description &Only
  143. Description and Example
  144. Description and &Example
  145. Choose Template
  146. templates
  147. Description and script
  148. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee.
  149. to handle buttonup
  150.     do this 
  151.         do that
  152. description only
  153. description and script
  154. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in orderrican butt.
  155. Description and example
  156. This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in order
  157. to handle buttonup
  158.     do this 
  159.         do that
  160. buttonclick
  161. buttonclick
  162. cancel
  163. buttonclick
  164. buttonclick
  165. Cancel
  166. description and script
  167. Get number of days in month
  168. Get number of days in month
  169. This handler returns the number of days there are in a month of a given year. Note that this handler requires the isLeapYear() handler, supplied below.
  170. Handler:    daysInMonth (<month>,<year>)
  171. Parameters:
  172. <month>:    An integer representing the month
  173. <year>:        A four-digit year
  174. Returns the number of days in the supplied month for that year.
  175. -- function: daysInMonth(<month>,<four-digit year>)
  176. -- Returns the number of days in a month.   
  177. -- NOTE: this function requires 4 digits for the year.  
  178. -- This function calls the function leapYear() defined below.
  179. -- example: to find out how many days are in February, 1992 
  180. -- set x to daysInMonth(2,1992) 
  181. to get daysInMonth m,y 
  182.     if m <> 2 
  183.         return item m of "31,28,31,30,31,30,31,31,30,31,30,31" 
  184.     else 
  185.         if leapYear(y) 
  186.             return 29 
  187.         else 
  188.             return 28 
  189.         end
  190. -- Returns TRUE if y is a leap year, FALSE if not.
  191. -- NOTE: this fuction requires a four digit year.
  192. -- Example:  Find out if 1992 is a leap year.
  193. -- if leapYear(1992)
  194. to get isLeapYear y
  195.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  196.         return TRUE
  197.     else
  198.         return FALSE
  199. origPage
  200. original
  201. Get number of days in month
  202. label
  203. {{{{{{{p{
  204. WINFILE INI 
  205. DOSAPP  INI 
  206. MPLAYER INI 
  207. WINMETERINI 
  208. WINCHAT INI 
  209. CLIPBRD INI 
  210. SCHDPLUSINI 
  211. NETWATCHINI 
  212. BABE    BMP 
  213. CLARIS  INI 
  214. HPPCL5MSX03 
  215. ESCHER  BM
  216. Icon Resources
  217. Save Text to a File (ASCII or RT
  218. Search and replace in a string
  219. Remove given char from string
  220. Remove given char from stringg
  221. This handler removes all instances of the specified character from the specified string.
  222. Handler: stripChar(<character to strip>,<string to strip it from>)
  223. Parameters:
  224. <character to strip>:    any single character
  225. <string to strip it from>:    the string from which to strip the character
  226. Returns the stripped string...
  227. -- removes all instances of chr from strng
  228. to get stripChar chr,strng
  229.     set chrLoc to offset(chr,strng)
  230.     while chrLoc > 0
  231.         clear char chrLoc of strng
  232.         set chrLoc to offset(chr,strng)
  233.     return strng
  234. stripChar
  235. stripChar chr,strng
  236. chrLoc 
  237. origPage
  238. original
  239. Remove given char from string
  240. label
  241. Bring up the Command Window
  242. Bring up the Command Window
  243. This one line script brings up the Command Window without using the Command menu item or the Shift + F3 key.  Often you will want to remove menu items that you aren't using at Author level, but you still need the Command window while working.
  244. origPage
  245. to handle buttonClick
  246.    show commandWindow
  247. end buttonClick
  248. original
  249. Bring up the Command Window
  250. label
  251. Bring up the Command Window
  252. Get day of week from date
  253.  + F3 key.  Often you will want to remove menu items that you aren't using at Author level, but you still need the Command window while working.
  254. origPage
  255. to handle buttonClick
  256.    show commandWindow
  257. end buttonClick
  258. original
  259. Bring up the Command Window
  260. label
  261. Spin controls
  262. origPage
  263. original
  264. Spin controls
  265. label
  266. Spin controls
  267. Below are some standard spin controls for selecting an integer, date, or time. To use the date and time spinners, click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
  268. Try out the spinners on the right. 
  269. To use the date and time spinners, first click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
  270. integerUp
  271. integer
  272. spinUp
  273. w%spinUp
  274. buttonDown
  275. w%spinUp
  276. buttonDoubleClick
  277. w%spinUp
  278. buttonStillDown
  279. spinUp
  280. "integer"
  281. integerDown
  282. integer
  283. spinDown
  284. |spinDown
  285. buttonDown
  286. |spinDown
  287. buttonDoubleClick
  288. |spinDown
  289. buttonStillDown
  290. spinDown
  291. "integer"
  292. integer
  293. dateButtons
  294. decrement
  295. dateUp
  296. increment
  297. month
  298. month
  299. actionItem
  300. buttonDown
  301. buttondoubleclick
  302. buttonStillDown
  303. "dateUp"
  304. actionItem 
  305. selectedHotwords 
  306. "day"
  307. "month"
  308. "year"
  309. dateUp
  310. dateDown
  311. increment
  312. evaluate(day)
  313. 03 / 13 / 988
  314. month
  315. timeButtons
  316. decrement
  317. timeUp
  318. ;seconds
  319. increment
  320. seconds
  321. minute
  322. minute
  323. actionItem
  324. buttonDown
  325. buttondoubleclick
  326. buttonStillDown
  327. "timeUp"
  328. actionItem 
  329. selectedHotwords 
  330. "hour"
  331. "Time" 
  332. "minute"
  333. "AMPM"
  334. timeUp
  335. timeDown
  336. increment
  337. evaluate(day)
  338. 08 : 42 : 45 PMM
  339. minute
  340. seconds
  341. Limit Length of Entry String
  342. origPage
  343. original
  344. Limit Length of Entry String
  345. label
  346. Limit Length of Entry Stringi
  347. This handler is to be installed into the script of a field. When a key is pressed, it checks that the charCount of the text of the field is within the limits specified in the script.   
  348. This is a handler for a built-in ToolBook message that is sent to a field each time the user presses a key.  Along with the keyChar message, Toolbook passes a parameter containing the unique code for the key pressed.
  349. Handler:   keyChar keyPressedsseddddameters are:
  350.    keyPressed   the key pressed by the user
  351. -- does not allow entry of more than specified
  352. -- amount of characters. Place this hander in a field.
  353. to handle keyChar keyPressed
  354.     local INT maxCharAllowed
  355.     local INT currentCount
  356.     maxCharAllowed = 10
  357.     currentCount = charCount(my text)
  358.     if (currentCount >= maxCharAllowed) \
  359.      or (keyPressed = keyEnter and currentCount >= \
  360.      maxCharAllowed - 1)
  361.         beep 1
  362.     else
  363.         forward
  364. Limit Length of Entry String
  365. Cursor Resources
  366. Add number of days to date
  367. Check for Alpha Non-Numeric Data
  368. origPage
  369. original
  370. Check for Alpha Non-Numeric Data
  371. label
  372. Check for Alpha Non-Numeric Data
  373. This function checks each character to ensure that it is a letter from in the range of A-Z or a-z.  To allow additional values or characters, you will need to add them to the string held in the variable "alphabet."
  374. Handler:    isStringAlpha (<testString>)
  375. Parameters:
  376. <testString>    
  377. Returns true if the string contains only alpha characters or null.
  378. pha characters or null.
  379. true      testString contained only alpha  characters (A-Z or a-z)  or  NULL
  380.    false      testString contained at least  one non-alpha character
  381. -- tests each character of testString, returns TRUE
  382. -- if all are alpha (non-numeric)
  383. to get isStringAlpha testString
  384.     alphabet = "abcdefghijklmnopqrstuvwxyz"
  385.     step i from 1 to charcount(testString)
  386.         if char i of testString is not in alphabet
  387.             return FALSE
  388.         end
  389.     return TRUE
  390. Bring ToolBook Window to Front
  391. Bring ToolBook Window to Front
  392. This script uses DDE to get the sysWindowHandle of another instance  of ToolBook.  It then calls Windows to bring that window to the front of the desktop. If that application is not running, it runs it.
  393. Handler:    bringWindowToFront <application>
  394. Parameters:
  395. <application>:     the name of theToolBook file   
  396. to handle bringWindowToFront appNameToRun
  397.     linkDLL "user"  
  398.         --bringWindowToTop is a Windows function that
  399.         --puts the Window whose window handle is passed to it
  400.         --in front of all the other windows.
  401.         INT bringWindowToTop(WORD)
  402.     end linkDLL
  403.     --getRemote returns 9 separate items in sysError  
  404.     --item 1 is the status of the remote request
  405.    getRemote "sysWindowHandle" application  toolBook topic appNameToRun
  406.     if (item 1 of sysError) is "OK"
  407.         get bringWindowToTop(it)
  408.         --bringWindowToTop doesn't size to page or even 
  409.         --restore it
  410.         executeRemote "send SizeToPage" application toolbook \
  411.          topic appNameToRun
  412.     else
  413.         --the app isn't running, so we'll start it
  414.         run appNameToRun
  415.     end if
  416. end      
  417. Front     
  418. origPage
  419. original
  420. Bring ToolBook Window to Front
  421. label
  422. Bring ToolBook Window to Front
  423. Using windows pointers
  424. Resizing a polypoint object
  425. Initialize Excel Conversation
  426. Initialize Excel Conversation
  427. This function will run Excel if it is not running already.  If a filename is passed to this function it will tell Excel to load that file if it is not loaded already. 
  428. Handler:    InitializeExcel  (<fileName>)
  429. Parameters:
  430. <filename>    optional; makes sure the file is open in Excel
  431. Returns true if it successfully established conversation with Excel
  432.    false        couldn't load Excel or, if provided, the file name given
  433. SysError values are those of the command executeRemote  (see the OpenScript Encyclopedia).
  434.    OK                     Conversation was succesfully established
  435.    Failed:No Server    Excel is not running with the expected file
  436.    Failed: xxxxx        Excel is running, but something is wrong
  437. to get InitializeExcel fileNameToRun
  438.     --Get the current status of Excel
  439.     getRemote "Status" application "Excel" topic "System"
  440.     --If it failed because there is no server
  441.     --run excel
  442.     if item 1 of sysError = "Failed: No Server" 
  443.         run "excel.exe" && fileNameToRun
  444.         getRemote "Status" application "Excel" topic "System"
  445.   end
  446.   --getRemote status should return Ready
  447.     if it <> "Ready" 
  448.         return false
  449.     end if
  450.     --Make sure that it is not minimized
  451.     executeRemote "[App.Restore()]" application "excel"
  452.     --If no file has been specified then return successfully
  453.     if fileNameToRun = NULL 
  454.         return true
  455.     --Check to see if fFileName is open and, if so, 
  456.     --make it active
  457.     executeRemote "[Activate(""" & fileNameToRun & """)]" \
  458.      application "excel" topic fileNameToRun
  459.     --If it failed because there is no server then try 
  460.     --opening the file
  461.     if item 1 of sysError = "Failed: No Server" 
  462.         executeRemote "[Open(""" & fileNameToRun & """)]" \
  463.          application "excel"
  464.     --If sysError is OK then success
  465.     if item 1 of sysError = "OK" 
  466.         return true
  467.     return false
  468. origPage
  469. original
  470. Initialize Excel Conversation
  471. label
  472. Initialize Excel Conversation
  473. label
  474. to handle enterApplication
  475.     system s_backMessageSent
  476.     -- initialize system variable
  477.     s_backMessageSent = false
  478.     -- turn off syshistory
  479.     syshistoryrecord = false
  480.     clear syshistory
  481.     forward
  482. to handle leavepage
  483.     system s_backMessageSent
  484.     -- only puts page on syshistory if navigation is *not* initiated by BACK
  485.     if targetWindow is mainWindow
  486.         if s_backMessageSent is false
  487.             push this page onto syshistory
  488.         else
  489.             s_backMessageSent = false
  490.         end
  491.     forward
  492. to handle back
  493.     system s_backMessageSent
  494.     if itemcount(syshistory) > 0
  495.         s_backMessageSent = true
  496.         pop syshistory
  497.         in mainwindow
  498.             go to it
  499.         end
  500.     else
  501.         request "You are already all the way back."
  502. Changing the behavior of BACK
  503. Changing the behavior of BACK
  504. These handlers, when placed in the book script of a ToolBook application, will make the BACK message behave like back behaves in WinHelp. 
  505. Note: be sure you forward any leavePage handlers located in a page or background script.
  506. Handlers:
  507. EnterApplication
  508. LeavePage
  509. Spin controls
  510. Graphic slider control
  511. Check for Valid File Name
  512. Search Path for File
  513. Verbose
  514. Sorting a 1-D array
  515. label
  516. Sorting a 1-D array
  517. -- The next three handlers make up a Standard recursive 
  518. -- QuickSort.
  519. to handle quicksort fArray[] by reference
  520.     system s_noSwap
  521.     set s_noSwap to 0
  522.     send quicksrt fArray, 1, dimensions ( fArray )
  523. to handle quicksrt fArray[] by reference, lo, hi
  524.     system  s_noSwap
  525.     if hi > lo 
  526.         send swap  fArray, lo, ((lo+hi) div 2)
  527.         set lst to lo
  528.         step i from (lo+1) to hi
  529.             if fArray[i] < fArray[lo] as text
  530.                 increment lst
  531.                 send swap fArray, lst, i
  532.             else
  533.                 increment s_noswap
  534.             end
  535.         end 
  536.         send swap fArray,lo,lst 
  537.            send quicksrt fArray, lo, lst-1
  538.         send quicksrt fArray, lst+1,hi
  539.        end
  540. to handle swap fArray[] by reference, x, y
  541.     local temp
  542.     set temp to fArray[x]
  543.     set fArray[x] to fArray[y]
  544.     set fArray[y] to temp
  545. end fArray[x]
  546.     set fArray[x] to fArray[y]
  547.     set fArray[y] to temp
  548. This is an OpenScript implementation of the standard recursive quick sort.
  549. Handler:      quickSort <arrayRef>
  550. Parameter:    
  551. <arrayRef>:      A one-dimensional array.
  552. Example:
  553.   local fArray[]
  554.   fill fArray with my text in [textline] order
  555.   send quickSort fArray
  556. Search Path for File
  557. origPage
  558. Search Path for File
  559. This script links to the function getDosEnvironmentString in TB30DOS.DLL to get the DOS path and then determines if the file is in that path.
  560. Handler:      fileInPath (<fileName>)
  561. Parameters:
  562. <fileName>    file name to search for
  563. Returns null if file is not found, or the first directory in the path that contains the file if found.
  564.    NULL        file not found
  565.    currentPath    the first directory in the path that contains the file
  566.    Null parameter    no file name was passed to function
  567. name was passed to function
  568. to get FileInPath fileNameToCheck
  569.     --If fileNameToCheck is null then fail immediately
  570.     if fileNameToCheck is NULL then
  571.         return null
  572.     end if
  573.     --Link to the tb30dos dll
  574.     linkDLL "tb30dos.dll"
  575.         INT fileExists (STRING)
  576.         STRING getDOSEnvironmentString (STRING)
  577.     end linkDLL
  578.     --Get the path list 
  579.     set currentPathList to   getDOSEnvironmentString ("PATH")
  580.     --Clear the 'Path=' at the beginning of the path list
  581.     get offset("=",currentPathList)
  582.     if it > 0 then
  583.         clear chars 1 to it of currentPathList
  584.     end if
  585.     --Convert the path list to a list of items    
  586.     get offset(";",currentPathList)
  587.     while it > 0
  588.         set char it of currentPathList to ","
  589.         get offset(";",currentPathList)
  590.     end while
  591.     --Search through the list, one path at a time
  592.     while currentPathList is not NULL
  593.         pop currentPathList into checkPath
  594.         if last char of checkPath is not "\"
  595.             put "\" after checkPath
  596.         end if
  597.         if fileExists(checkPath & fileNameToCheck) = 1
  598.             return checkPath
  599.         end if
  600.     end while
  601.     --Unable to find file in the path
  602.     return null
  603. original
  604. Search Path for File
  605. label
  606. Get Current Path Setting
  607. origPage
  608. original
  609. Get Current Path Setting3
  610. This script links to the function getDosEnvironmentString in TB30DOS.DLL to get the current DOS path setting. This handler returns the path currently specified in your DOS environment.
  611. Handler:      findCurrentPath
  612. No parameters.
  613. RRath setting
  614. to get findCurrentPath
  615.    --Link to the tb30dos dll
  616.     linkDLL "tb30dos.dll"
  617.         STRING getDOSEnvironmentString (STRING)
  618.      end linkDLL
  619.    --Get the path list 
  620.       set currentPathSetting to  getDOSEnvironmentString ("PATH")
  621.       return currentPathSetting
  622. end findCurrentPath
  623. Get Current Path Setting
  624. label
  625. Get Current Path Setting
  626. Remove given char from string
  627. Convert textlines to list
  628. Insert/Overwrite field
  629. origPage
  630. Insert/Overwrite fieldA
  631. This field toggles between insert and overwrite mode when you press the insert key. All handlers are in the field.ndlers are in the field.
  632. Type in the field to the right. 
  633. Pressing the insert key toggles between insert and overwrite modes.
  634. overWriteFlag
  635. false
  636. keyDown
  637. overWriteFlag
  638. keyChar
  639. overWriteFlag
  640. enterpage
  641. 4logical overWriteFlag
  642. Y <> 
  643. notifybefore 
  644. notifyafter 
  645. Now is the time for all good men to come to the aid of their country..............................................wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  646. terpage
  647. enterpage
  648. original
  649. Insert/Overwrite field
  650. label
  651. eld.ndleIO      SYS
  652. MSDOS   SYS
  653. DOS        
  654. WIN        
  655. DOSAPPS    
  656. ADAPTEC    
  657. UTIL       
  658. MSMAIL     
  659. PSFONTS    
  660. VIEWER     
  661. NETFILES   
  662. MSVC       
  663. Auto-scroll field
  664. Converting to Binary, Hex, Octal
  665. intro
  666. <Introduction>
  667. Dragging Objects
  668. label
  669. Dragging Objects
  670. to handle buttondown loc
  671.     local stack bnds,mouseOffset
  672.     linkdll "user"
  673.         int getsystemmetrics(int)
  674.     -- check if the user has swapped mouse buttons.
  675.     if getsystemmetrics(23) >0
  676.         set leftMouseButton to keyRightButton
  677.     else
  678.         set leftMouseButton to keyLeftButton
  679.     set bnds to bounds of target
  680.     set mouseOffset to item 1 of loc - item 1 of bnds,\
  681.       item 2 of loc - item 2 of bnds
  682.     leftMouseButton=keyLeftButton
  683.     while keystate(leftMouseButton)is down
  684.         newloc = sysMousePosition
  685.         if newLoc <> loc
  686.             set position of target to \
  687.               item 1 of newLoc-item 1 of mouseOffset,\
  688.               item 2 of newLoc-item 2 of mouseOffset
  689.             set loc to newLoc
  690.         end
  691. Put the script below in an object that you want to drag with the mouse. Note: if you want to drag a group, change the references from arget
  692. Display 2-D array values
  693. Testola
  694. description only
  695. in,ms
  696. ThreeDeeRect
  697. subtopicname
  698. level
  699. reader
  700. author
  701. false
  702. author
  703. enterpage
  704. notifybefore 
  705. explanation
  706. reader
  707. author
  708. enterpage
  709. bottomLine
  710. topLine
  711. Converting to Binary, Hex, Octal
  712. Converting to Binary, Hex, Octal
  713. The Format command has been extended to allow conversion between Binary, Hex, and Octal number systems. The following are the new format strings
  714.     Binary:            "@b"
  715.     Octal:           "@o"
  716.     Hex:            "@h"
  717.     Decimal:       "@d"
  718. These strings precede the normal number format string. So to convert a variable "n" from decimal to hexidecimal, you could use the following command:
  719.     format number n as "@h0"
  720. To convert it back to decimal, you'd do this:
  721.     format number n as "@d0"
  722. n convertTo is "Hexidecimal" 
  723.             format number numberEntered as "@h#"
  724.         else 
  725.             format number numberEntered as "@o#"
  726.    end conditions
  727.       return numberEntered
  728. end doConversion
  729. origPage
  730. original
  731. Converting to Binary, Hex, Octal
  732. label
  733. Binary Insertion of Textline
  734. Binary Insertion of Textline into Field
  735. label
  736. origPage
  737. original
  738. Binary Insertion of Textline
  739. -- use if inserting a single line. Will maintain sorted order
  740. to get insertLine txt,newLine
  741.     if txt is null
  742.         return newLine
  743.     set start to 1  -- first textline
  744.     set tlc to textlinecount(txt)
  745.     set ending to tlc -- last textline
  746.     local insertSpot
  747.     while start <= ending 
  748.         set midPoint to (start+ending) div 2 
  749.         set middleLine to textline midPoint of txt
  750.         conditions
  751.             when newLine < middleLine as text
  752.                 -- start looking at values less than current midPoint
  753.                 set ending to midPoint-1
  754.                 set insertSpot to midPoint
  755.             when newLine > middleLine as text
  756.                 -- start looking at values greater than current midPoint
  757.                 set start to midPoint+1
  758.                 set insertSpot to midPoint+1
  759.             else
  760.                 -- the item already exists
  761.                 set insertSpot to midPoint
  762.                 break while
  763.         end
  764.     if insertSpot > tlc
  765.         put newLine before textline insertSpot of txt
  766.     else
  767.         put newLine&crlf before textline insertSpot of txt
  768.     return txt
  769. Inserts a textline into a string delimited by CRLFs, maintaining sorted order.
  770. Handler:    InsertLine (<txt>,<newLine>)
  771. Parameters:
  772. <txt>            Text, sorted by textLine
  773. <newLine>    The new line to insert.
  774. Example of use:
  775.   text of field "f" = insertLine(text of field "f",newLine)
  776. wwwwp
  777. wwwwp
  778. wwwww
  779. wwwwwp
  780. Using windows pointers
  781. windows m
  782. origPage
  783. original
  784. Using windows pointers
  785. The following functions are helpful if you need to allocate a pointer for calling a windows function.
  786. getWinPointer ( <nsize> )
  787. Use this to get a locked pointer.
  788. Parameter:    <nsize>: the size in bytes to allocate
  789. Return value:    Returns a reference to a locked pointer that you can pass
  790.         to a windows function requiring a pointer.
  791. freeWinPointer (<pointer Variable>)
  792. Frees a locked pointer, recovering memory.
  793. Parameter:    <pointer variable>: the variable returned from 
  794.         getWinPointer()
  795. Return value:    Returns 0 if successful, a positive integer if not.
  796. linkMemFunctions
  797. Links the functions necessary for the above handlers.
  798. Parameters:    None.....rs:    None.
  799. -- the link statements for needed functions below
  800. to handle linkMemFunctions
  801.     linkDLL "KERNEL"
  802.         WORD     GlobalAlloc(WORD,DWORD)
  803.         WORD     GlobalFree(WORD)
  804.         WORD     GlobalHandle(WORD)
  805.         POINTER GlobalLock(WORD)    
  806.         WORD     GlobalUnlock(WORD)
  807. to get getWinPointer nSize
  808.     local word hMem
  809.     local retValue
  810.     hMem = GlobalAlloc(66,nSize)
  811.     return GlobalLock(hMem)
  812. to get freeWinPointer pMem
  813.     local word hMem, retValue
  814.     hMem = GlobalHandle(item 1 of pMem)
  815.     retValue = GlobalUnlock(hMem)
  816.     return GlobalFree(hMem)
  817. enddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
  818. Using windows pointers
  819. label
  820. Using a RECT structure
  821. origPage
  822. original
  823. Using a RECT structure
  824. label
  825. Using a RECT structure]
  826. The following functions are useful for dealing with windows functions that require or return a RECT structure.
  827. setRect <vertices>,<pRect>
  828. This sets the values of the RECT structure in pRect. Useful if you must pass a filled RECT structure to a Windows function.
  829. Parameters:
  830. <vertices>:    The vertices of the rectangle.
  831. <pRect>:    The pointer to the RECT structure. (8 bytes)
  832. getRect <pRect>
  833. This extracts the vertices from a filled RECT structure. 
  834. Parameter:    <pRect>: The pointer to a RECT structure. (8 bytes)
  835. getWinPointer ( <nsize> )
  836. Use this to get a locked pointer.
  837. Parameter:    <nsize>: the size in bytes to allocate
  838. Return value:    Returns a reference to a locked pointer that you can pass
  839.         to a windows function requiring a pointer.
  840. freeWinPointer (<pointer Variable>)
  841. Frees a locked pointer, recovering memory.
  842. Parameter:    <pointer variable>: the variable returned from 
  843.         getWinPointer()
  844. Return value:    Returns 0 if successful, a positive integer if not.
  845. linkMemFunctions
  846. Links the functions necessary for the above handlers.
  847. Parameters:    None.....Functions
  848. Links the functions necessary for the above handlers.
  849. Parameters:    None...e.y for the above handlers.
  850. Parameters:    None.
  851. -- lst is a list of 4 integers
  852. -- pRect is a locked pointer to 8 bytes
  853. to handle setRect lst,pRect
  854.     step i from 0 to 6 by 2
  855.         pop lst
  856.         get pointerInt(i,pRect,it)
  857. -- pRect is a locked pointer to 8 bytes
  858. to get getRect pRect
  859.     local retval
  860.     step i from 6 to 0 by -2
  861.         push pointerInt(i,pRect) onto retval
  862.     return retval
  863. -- the link statements for needed functions below
  864. to handle linkMemFunctions
  865.     linkDLL "KERNEL"
  866.         WORD     GlobalAlloc(WORD,DWORD)
  867.         WORD     GlobalFree(WORD)
  868.         WORD     GlobalHandle(WORD)
  869.         POINTER GlobalLock(WORD)    
  870.         WORD     GlobalUnlock(WORD)
  871. to get getWinPointer nSize
  872.     local word hMem
  873.     local retValue
  874.     hMem = GlobalAlloc(66,nSize)
  875.     return GlobalLock(hMem)
  876. to get freeWinPointer pMem
  877.     local word hMem, retValue
  878.     hMem = GlobalHandle(item 1 of pMem)
  879.     retValue = GlobalUnlock(hMem)
  880.     return GlobalFree(hMem)
  881. enddddddddddddddddddd
  882.     return GlobalFree(hMem)
  883. Sorting a 2-D array
  884. origPage
  885. original
  886. Sorting a 2-D array
  887. label
  888. Sorting a 2-D array
  889. Think of a 2-D array as a table in which the first dimension refers to  rows and the second dimension refers to columns. This function sorts the "rows" of a two dimensional array by the values of one of its columns.
  890. You pass it the array you want to sort, the column you want to sort by, and the "datatype" of the column you want to sort. (Either "text", "date", or "number")/
  891. Click on the radio buttons to the right to sort the table by the associated column.
  892. Note: the "table" to the right is a tab-delimited field with two vertical lines drawn over it. The handlers in the buttons load this text into a 2D array and pass it to a handler in this page, specifying the column and type for the sort.     rt.        
  893. stwoDquickSort
  894. sortField
  895. buttonclick
  896. buttonclick
  897. Zretval
  898. Zx[][]
  899. fref 
  900. "sortField"
  901.     fill x 
  902. g] order
  903. calls the sorting routine. Note 
  904. column
  905. 'array 
  906. specified, 
  907. be sorted 
  908. twoDquickSort x,1,"
  909. part loads 
  910. dimensions(x)
  911. x[i][j] 
  912. Number
  913. stwoDquickSort
  914. number
  915. sortField
  916. buttonclick
  917. buttonclick
  918. Zretval
  919. Zx[][]
  920. fref 
  921. "sortField"
  922.     fill x 
  923. g] order
  924. twoDquickSort x,2,"
  925. dimensions(x)
  926. x[i][j] 
  927. Number
  928. stwoDquickSort
  929. sortField
  930. buttonclick
  931. buttonclick
  932. Zretval
  933. Zx[][]
  934. fref 
  935. "sortField"
  936.     fill x 
  937. g] order
  938. twoDquickSort x,3,"
  939. dimensions(x)
  940. x[i][j] 
  941. Sort by:
  942. sortField
  943. a    3    5/23/91
  944. b    2    3/11/92
  945. c    4    4/1/06
  946. d    9    11/13/66
  947. e    0    7/4/76
  948. f    6    7/7/64
  949. g    7    4/1/23
  950. h    1    2/9/55
  951. i    5    3/1/29
  952. a    8    1/12/93
  953. Using a RECT structure
  954. isLeapYear()
  955. Get number of days in month
  956. Think of a 2-D array as a table in which the first dimension refers to  rows and the sec
  957. resize
  958. Get Free Disk Space on a Drive
  959. origPage
  960. original
  961. Get Free Disk Space on a Drive9
  962. This script links to the function called getFreeDiskSpace in the tb30dos.dll to get the amount of disk space currently available on a particular drive.
  963. Handler:    findDiskSpace (<drive>)
  964. Parameters:
  965. <drive>        the name of the drive to check
  966. Returns the amount of space available on a  particular drive..ror
  967.      
  968.      
  969. ve an error
  970.      
  971. to get findDiskSpace whatDrive
  972.     local LONG diskSpaceAvailable
  973.     --Link to the tb30dos dll
  974.     linkDLL "tb30dos.dll"
  975.         LONG getFreeDiskSpace(STRING)
  976.     end linkDLL
  977.     set diskSpaceAvailable to getFreeDiskSpace(whatDrive)
  978.     return diskSpaceAvailable
  979. Get Free Disk Space on a Drive
  980. label
  981. Get Free Disk Space on a Drive
  982. Exit and restart windows
  983. Insert/Overwrite field
  984. Convert textlines to list
  985. origPage
  986. original
  987. Convert textlines to list
  988. label
  989. Convert textlines to list
  990. This handler converts a string delimited by CRLFs to a list.
  991. Handler:    textLinesToList (<textLines>)
  992. Parameters:
  993. <textLines>    a string delimited by CRLFs
  994. Returns a list, each item representing a textline.................
  995. -- converts string delimited by CRLFs to a list
  996. to get textLinesToList txt
  997.     local stack lst
  998.     step i from textlinecount(txt) to 1 by - 1
  999.         push textline i of txt onto lst
  1000.     return lst
  1001. Exit and restart windows
  1002. Exit and restart windows
  1003. label
  1004. --When restart is true, Windows will exit and restart.  
  1005. --If if restart is null or false, Windows will just exit.
  1006. to handle exitWindows restart
  1007.     linkDLL "user"
  1008.         INT ExitWindows (DWORD, INT)
  1009.     end linkDLL
  1010.     if restart is true
  1011.             get ExitWindows (66, 0)
  1012.     else
  1013.             get ExitWindows (67, 0)
  1014.     end 
  1015.     end 
  1016. dows (66, 0)
  1017.     else
  1018.             get ExitWindows (67, 0)
  1019.     end 
  1020.     end 
  1021.     end 
  1022. end buttonUp
  1023. nd buttonUp
  1024. nd buttonUp
  1025. Calling this handler will cause Windows to exit. You can optionally specify that Windows restarts after exiting.
  1026. Handler:    exitWindows <restart>
  1027. Parameters:
  1028. <restart>    True if you want to restart Windows
  1029. n Windows will just Exit.
  1030. origPage
  1031. original
  1032. Exit and restart windows
  1033. Get day of week from date
  1034. Get day of week from date
  1035. label
  1036. -- returns the weekday of any day beyond 1/1/1700: 
  1037. -- note: requires full year. Example: get weekDay("1/1/1993")
  1038. -- also requires isLeapYear() function below
  1039. to get dayOfWeek pdate
  1040.     -- make a list out of the date
  1041.     format date pdate as "m,d,y" from "m/d/y"
  1042.     set m to item 1 of pdate 
  1043.     set d to item 2 of pdate 
  1044.     set y to item 3 of pdate 
  1045.     -- the following list (1 item for each month) contains the 
  1046.     -- number of days that have passed before first day of 
  1047.     -- each month.
  1048.     set days to "0,31,59,90,120,151,181,212,243,273,304,334" 
  1049.     -- set numdays to number of days elapsed since 1/1/1700 
  1050.     set numdays to (y-1700) div 4-(y-1700) div 100 +(y-1600) \
  1051.      div 400 + 365 * (y - 1700) + item m of days + d -1 
  1052.     if isLeapYear(y) and m <= 2 
  1053.         decrement numdays by 1 
  1054.     end 
  1055.     set n to  (numdays-2) mod 7 +1
  1056.     return item n of \
  1057.      "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" 
  1058. -- Returns TRUE if y is a leap year, FALSE if not.
  1059. -- NOTE: this fuction requires a four digit year.
  1060. -- Example:  Find out if 1992 is a leap year.
  1061. -- if leapYear(1992)
  1062. to get isLeapYear y
  1063.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  1064.         return TRUE
  1065.     else
  1066.         return FALSE
  1067. urn TRUE
  1068.     else
  1069.         return FALSE
  1070. This handler returns the day of the week (Monday, Tuesday, etc) from any given date since 1/1/1700. Note that you must provide a four-digit year.
  1071. Note that this function requires the handler isLeapYear, included below.
  1072. Handler:    dayOfWeek(<date>)
  1073. Parameters:
  1074. <date>        A date in this format: "1/1/1994"
  1075.         (Note a four-digit year is required.)
  1076.  year is required.)
  1077. origPage
  1078. original
  1079. Get day of week from date
  1080. isLeapYear()
  1081. isLeapYear()
  1082. label
  1083. This function returns true if a given date is a leap year, false if not. Note that it requires a four digit year.
  1084. Handler:    isLeapYear (<year>)
  1085. Parameters:
  1086. <year>:        a four-digit number representing a year
  1087. -- Returns TRUE if y is a leap year, FALSE if not.
  1088. -- NOTE: this fuction requires a four digit year.
  1089. -- Example:  Find out if 1992 is a leap year.
  1090. -- if leapYear(1992)
  1091. to get isLeapYear y
  1092.     if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
  1093.         return TRUE
  1094.     else
  1095.         return FALSE
  1096. origPage
  1097. original
  1098. isLeapYear()
  1099. BitwiseAND, OR, and XOR
  1100. Notify Handler
  1101. Sorting a 2-D array
  1102. intro
  1103. SubtopicName
  1104. Simple Drop Down Field
  1105. Remove trailing spaces
  1106. 2P$H$H$
  1107. <Introduction>
  1108.     B    n    
  1109. B z V!
  1110. origPage
  1111. label
  1112. selectChars
  1113. original
  1114. Introduction
  1115. This book is a library of scripts useful in OpenScript programming. 
  1116.  To go to a given topic, click a topic in the list. 
  1117.  To view topics related to a given category, choose the desired category.
  1118.  Use the search button to search for a topic by key word.
  1119.  Use the splitter bar to resize the navigation panel to the left.
  1120. Note: you can add new topics to this book by pressing F3 (to enter author mode) and using the topic buttons that appear at the lower left...tons that appear at the lower left.
  1121. Yes, this is a button.
  1122. buttonclick
  1123. buttonclick
  1124. "Yes, 
  1125. Yes, this is a button.
  1126. buttonclick
  1127. buttonclick
  1128. "Yes, 
  1129. out,true
  1130. ThreeDeeRect
  1131. bottomLine
  1132. topLine
  1133. OpenScript
  1134. Libraryy Base
  1135. 10,14
  1136. <Introduction>
  1137. 10,14
  1138. <About this book>
  1139. Binary Insertion of Textline
  1140. scriptChooserDialog
  1141. ButtonStillDown Page Navigation
  1142. ButtonStillDown Page Navigation
  1143. These simple scripts implement multiple page navigation when the mouse button is held down. 
  1144. Handlers:       
  1145. buttonDown
  1146. buttonStillDown
  1147. No parameters
  1148.     none
  1149. ering actions (ie - called XXbuttonDown rather than buttonDown)
  1150. Handlers in this script are:
  1151.    buttonDown
  1152. Parameters are:
  1153.     none
  1154. to handle buttonDown
  1155.    go to next page 
  1156. end buttonDown
  1157. to handle buttonStillDown
  1158.        send buttondown
  1159. end buttonStillDown
  1160. tonDown
  1161. to handle XXbuttonStillDown
  1162.        send buttondown
  1163. end XXbuttonStillDown
  1164. origPage
  1165. original
  1166. ButtonStillDown Page Navigation
  1167. label
  1168. scriptChooserDialog
  1169. ButtonStillDown Page Navigation
  1170. ButtonStillDown Page Navigation
  1171. These simple scripts i
  1172. Navigation
  1173. Check for State Abbreviation
  1174. Auto-scroll field
  1175. origPage
  1176. original
  1177. Auto-scroll field
  1178. label
  1179. Auto-scroll field
  1180. This field's scrollbar automatically appears when necessary.
  1181. Type in the field to the right.
  1182. When appropriate, scroll bars will automatically appear.
  1183. zashowOrHideScrollbar
  1184. enterPage
  1185. zashowOrHideScrollbar
  1186. leaveField
  1187. zashowOrHideScrollbar
  1188. keyUp
  1189. zashowOrHideScrollbar
  1190. paste
  1191. zashowOrHideScrollbar
  1192. zashowOrHideScrollbar
  1193. clear
  1194. showOrHideScrollbar
  1195. notifyBefore 
  1196. showOrHideScrollbar
  1197. notifyAfter 
  1198. Something for something, nothing for nothing.788sdf
  1199. enterPage
  1200. leaveField
  1201. keyUp
  1202. paste
  1203. clear
  1204. description and example
  1205. SubtopicName
  1206. level
  1207. reader
  1208. author
  1209. false
  1210. author
  1211. enterpage
  1212. notifybefore 
  1213. explanation
  1214. Example:
  1215. in,true
  1216. ThreeDeeRect
  1217. bottomLine
  1218. topLine
  1219. View Scripts
  1220. author
  1221. reader
  1222. author
  1223. rectangle
  1224. enterpage
  1225. notifybefore 
  1226. author
  1227. reader
  1228. author
  1229. dotted
  1230. enterpage
  1231. notifybefore 
  1232. author
  1233. reader
  1234. enterpage
  1235. bottomLine
  1236. topLine
  1237. in,ms
  1238. ThreeDeeRect
  1239. in,ms
  1240. in,sculpted
  1241. .&,    "
  1242. scrolling
  1243. rectangle
  1244. explanation
  1245. enterpage
  1246. notifyBefore 
  1247. fref 
  1248. "explanation" 
  1249. txtOver 
  1250. 8= 0 
  1251. Search and replace in a string
  1252. As Word
  1253. label
  1254. This page contains a function that searches text for all occurrences of one string and replaces them with another. You can specify that you only want to replace the searched string if it's a whole word.
  1255. handler: searchReplace(<txt>,<searchTxt>,<replaceTxt>,<asWord>)
  1256. Parameters:
  1257. <text>:        the string you'll be searching in
  1258. <searchTxt>:    the substring you're looking for
  1259. <replaceTxt>:    the substring you want to replace for 
  1260. <as word>:    "true" if you want to replace only whole words.
  1261. Returns modified text
  1262. odified text
  1263. ext>:        the string you'll be searching in
  1264. <searchString>:    the substring you're looking for
  1265. <replaceString>:    the substring you want to replace for <searchString>
  1266. <as word>:    "true" if you want to replace only whole words.
  1267. Returns modified text
  1268. elimit = " " & tab & crlf & "-+*/<>,()[];^=&.?':" & quote 
  1269.     while runningTotal <= totalChars
  1270.         set curTxt to chars runningTotal to totalChars of txt
  1271.         curOffset = offset(searchFor,curTxt)
  1272.         if curOffset = 0
  1273.             break while
  1274.         else
  1275.             startPos = (runningTotal+curOffset-1)
  1276.             endPos = (runningTotal+curOffset+searchLen-2)
  1277.             if asWord is true
  1278.                 -- test if this occurance is an isolated word:
  1279.                 if not ((startPos = 1 or char (startPos - 1) \
  1280.                  of txt is in wordDelimit) and\
  1281.                  (endPos = totalChars or char endPos + 1 \
  1282.                  of txt is in wordDelimit))
  1283.                      increment runningTotal by curOffset+searchLen-1
  1284.                     continue while
  1285.                 end
  1286.             end
  1287.             set chars startPos to endPos of txt to replaceWith
  1288.             increment runningTotal by curOffset+replaceLen-1
  1289.             increment totalChars by replaceLen - searchLen
  1290.         end        
  1291.     return txt
  1292. replaceLen - searchLen
  1293.         end        
  1294.     return txt
  1295. Search and replace in a string
  1296. The quick red fox jumped over the lumpy log. The fox, being inquisitive by nature and not really in any hurry, stopped to examine the underside of the log in an olfactory sort of way. "Those blasted dogs," he thought to himself. "Who do they think they are?" Seconds later he was ripped to shreds.hreds.
  1297. asWord
  1298. Search Textng
  1299. Replace Textng
  1300. Search and Replace
  1301. searchReplace
  1302. searchString
  1303. replaceString
  1304. asWord
  1305. searchReplace
  1306. searchString
  1307. /searchReplace
  1308. replaceString
  1309. buttonup
  1310. "searchReplace"
  1311. searchString 
  1312. replaceString 
  1313. asWord 
  1314. rabbit
  1315. Try searching and replacing various words in the paragraph to the right. 
  1316. Note: when the As Word button is checked, only strings that exist as whole words in the text will be substituted..............
  1317. searchAndReplace
  1318. origPage
  1319. original
  1320. Search and replace in a string
  1321. Remove trailing spaces
  1322. Remove trailing spaces
  1323. label
  1324. This function removes all trailing spaces, as well as other undesirable characters.
  1325. Handler:    trim(<string to trim>)
  1326. Parameters:
  1327. <string to trim>    The string from which you want to remove the trailing stuff.
  1328. Returns the modified string
  1329. -- removes trailing spaces, tabs, and crlf's
  1330. to get trim strng
  1331.     local charsToDrop
  1332.     set charsToDrop to space & crlf & tab
  1333.     while charcount(strng) > 0 and last char of strng is in charsToDrop
  1334.         clear last char of strng
  1335.     return strng
  1336. origPage
  1337. original
  1338. Remove trailing spaces
  1339. categories 
  1340. the "prompt" 
  1341. , selecting
  1342.  current 
  1343. Mbelongs 
  1344. that 
  1345. -- category. (
  1346. Ncan 
  1347. more than one 
  1348. myID 
  1349. myTopic 
  1350. label 
  1351. "Choose 
  1352. M" && 
  1353. ZmainStruct[][]
  1354. categoryStruct 
  1355. fref 
  1356. arraySize 
  1357. dimensions(
  1358. si][1] 
  1359.         -- 
  1360. o i, 
  1361.         -- 
  1362. selectedTextLine 
  1363. itemOffset(
  1364. i][2]) > 0
  1365.         -- 
  1366. kunless we are on 
  1367. selectedTextlines 
  1368. -- update 
  1369. compileCategories
  1370. selectedTextLines 
  1371.     -- walk through 
  1372.         -- 
  1373. ) > 0
  1374.             -- 
  1375. xalready assigned, 
  1376. i][2])=0
  1377. i][2]
  1378.             -- 
  1379.             -- exists
  1380. itemLoc 
  1381. i][2])
  1382. i][2]
  1383.  structure
  1384. "month"
  1385. "day"
  1386. "year"
  1387. value
  1388. ZLONG days
  1389.  = daysInMonth()
  1390. 5) + 1
  1391. %"00"
  1392. %"00"
  1393.  < 1 
  1394. outside range 1 
  1395. %"00"
  1396. k12) + 1
  1397. %"00"
  1398. %"00"
  1399.  < 1 
  1400.  > 12
  1401. &&"out 
  1402. %"00"
  1403.  + 1) 
  1404. %"00"
  1405. %"00"
  1406.  < 0 
  1407.  > 99
  1408. %"00"
  1409. initialize
  1410. 4OBJECT newHotwordID
  1411. %"mm / dd / yy" 
  1412.     m = 
  1413. m <> 2
  1414. "31,28,31,30,31,30,31,31,30,31,30,31"
  1415.         y = 
  1416. k4 = 0 
  1417. k100 <> 0) 
  1418. k400 = 0)
  1419.  Standard ToolBook messages 
  1420. enterApplication
  1421.     -- link needed dll's
  1422.     linkDLL "tb30win.
  1423. displayBitsPerPixel()
  1424.     -- these gdi calls are used 
  1425. drawing separator 
  1426. getDeviceCaps(
  1427. moveTo(
  1428. lineTo(
  1429. setROP2(
  1430. gcreatePen(
  1431. deleteObject(
  1432. gselectObject(
  1433. Xuser
  1434. ggetDC(
  1435. releaseDC(
  1436. backcolor (a "
  1437. " handler, below) depending on
  1438.     -- the 
  1439. colors displayed.
  1440. numColors()
  1441. > 16 
  1442. darkerBlue()
  1443. lighterBlue()
  1444. "navigationBar"
  1445.         -- initialize combobox 
  1446. "categories" 
  1447. "<All 
  1448. populate "
  1449. "Topics"
  1450. hideControls
  1451. buttons 
  1452. modifying 
  1453. showControls
  1454. "CategoryButtons" 
  1455. "Navigation"
  1456. 7 - 60
  1457. deleted, updates 
  1458. category array (struct[][]) userProperty 
  1459.     -- Each row 
  1460. Bhas 
  1461. a list
  1462. numbers 
  1463. belonging 
  1464. that 
  1465. }. This 
  1466.     -- walks through 
  1467. , finding every instance 
  1468. found, 
  1469. removes 
  1470. "description 
  1471. example,
  1472. only"
  1473. Zx[][]
  1474. categoryStruct 
  1475. pageID 
  1476. dimensions(x)
  1477. itemOffset(
  1478. 7,x[i][2])
  1479. x[i][2]
  1480. a content 
  1481.         -- 
  1482. ensure 
  1483. label property
  1484.         -- 
  1485.  holds 
  1486. each 
  1487. fref 
  1488. "subTopicName" 
  1489.         -- 
  1490. necessary
  1491. "explanation"
  1492.         -- 
  1493. scrollbars, 
  1494. txtOver 
  1495. ;= 0 
  1496.  Utility handlers 
  1497. -- returns 
  1498. extractName t
  1499. tabOffset 
  1500. following a 
  1501. extractID t
  1502. lastTabLoc 
  1503. U(t) 
  1504. instances 
  1505. stripChar chr,strng
  1506.     hdc = 
  1507. windowhandle 
  1508.     retval = 
  1509. %,24)
  1510. 212,79.1875,71.6875
  1511. 180,75.125,100
  1512. backColor 
  1513. value
  1514. bckgrnds 
  1515. "intro,
  1516. curBack 
  1517.  Handlers 
  1518. dealing 
  1519. structure 
  1520. during authoring 
  1521. debugging purposes)
  1522. showCategoryStruct
  1523. Zx[][]
  1524. x[i][1] 
  1525. 9& x[i][2] & 
  1526. handers 
  1527. twoDquicksort fArray[][],n,dtype
  1528. 4stbk_noSwap
  1529. twoDquicksrt 
  1530. 6, 1, 
  1531. E),n,
  1532. U l, r,n,
  1533. r > l 
  1534. x, l, ((l+r) 
  1535. (l+1) 
  1536. test 
  1537. i][n] < 
  1538. l][n] 
  1539. i][n] < 
  1540. l][n] 
  1541. i][n] < 
  1542. l][n] 
  1543. stbk_noswap
  1544. , l, 
  1545. -1,n,
  1546. , lst+1,r,n,
  1547.  a, b
  1548. Ztemp
  1549. farray[a][i]
  1550. b][i]
  1551. b][i] 
  1552. -- ToolBook sends 
  1553. message just 
  1554. 4displaying
  1555. -- the dropdown 
  1556. a comboBox
  1557. enterDropDown
  1558. updateDropDownList
  1559. -- puts 
  1560. Fcategories 
  1561. Tlist
  1562. ZmainStruct[][]
  1563. categoryStruct 
  1564. arraySize 
  1565. dimensions(
  1566. [i][1] 
  1567. odropDownItems 
  1568. "<All 
  1569. N>" & 
  1570. a combobox 
  1571. selectChange value
  1572.  selcted 
  1573.     -- navigation 
  1574. populate "
  1575. i][1]=
  1576. amainstruct[i][2] 
  1577. -- kill 
  1578. , so 
  1579. goes 
  1580. leaveDropDown
  1581. -- adds the 
  1582. navigation 
  1583. -- called on 
  1584. whenever 
  1585. 1combobox value 
  1586. -- Note: each 
  1587. will be 
  1588. like such:
  1589. -- <label 
  1590. zhangs out beyond 
  1591. edge 
  1592. used 
  1593. populate 
  1594. ZallTopics
  1595. X"tb30dlg.dll"
  1596. sortTextLines(
  1597. "All"
  1598.             -- walk every 
  1599. content backgrounds, 
  1600.             -- a list 
  1601. their labels.
  1602. bckgrnds 
  1603. "intro,description 
  1604. example,
  1605. only"
  1606. backRef 
  1607. pageRef 
  1608.             -- 
  1609. numbers 
  1610. category
  1611. trailing 
  1612.     -- update 
  1613.     -- adjust 
  1614. selectedTextlines 
  1615. U, navigate 
  1616. that 
  1617. extractID(
  1618. clicked.
  1619. buttonclick 
  1620. -- returns the weekday 
  1621. beyond 1/1/1700: 
  1622. -- note: requires full year. Example: 
  1623. weekDay("1/1/1993")
  1624. -- also 
  1625. 8isLeapYear() function below
  1626. : pdate
  1627. aa list out 
  1628. %"m,d,y" 
  1629. "m/d/y"
  1630. following 
  1631. each month) 
  1632. days that have passed 
  1633. &o "0,31,59,90,120,151,181,212,243,273,304,334" 
  1634. numdays 
  1635. ielapsed since 1/1/1700 
  1636. (y-1700) 
  1637. y4-(y-1700) 
  1638. y100 +(y-1600) \
  1639. y400 + 365 * (y - 1700) + 
  1640. + d -1 
  1641. m <= 2 
  1642. k7 +1
  1643.      "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" 
  1644. -- Returns TRUE 
  1645. a leap 
  1646. , FALSE 
  1647. -- NOTE: 
  1648. fuction 
  1649. a four digit 
  1650.  Find 
  1651. 1992 
  1652. leapYear(1992)
  1653. k4 = 0 
  1654. k100 <> 0) 
  1655. k400 = 0))
  1656. -- keep 
  1657. mind that arrays are passed 
  1658. Hreference, 
  1659. Hvalue
  1660. twoDquicksort fArray[][] 
  1661. 2sortColumn,dtype
  1662. 4stbk_noSwap
  1663. twoDquicksrt 
  1664. C, 1, 
  1665. dimensions(
  1666. lo, hi,
  1667. hi > lo 
  1668. , lo, ((lo+hi) 
  1669. (lo+1) 
  1670. test 
  1671. stbk_noswap
  1672. , lo, lst-1,
  1673. +1,hi,
  1674. Ztemp
  1675. farray[a][i]
  1676. b][i]
  1677. b][i] 
  1678. function searches txt 
  1679. occurrences 
  1680. searchString 
  1681. replaces 
  1682. freplaceString.
  1683. -- If asWord 
  1684. Conly where 
  1685. Tappears 
  1686. -- (A 
  1687. defined 
  1688. that 
  1689. preceded 
  1690. followed 
  1691. -- either 
  1692.  beginning 
  1693. -- wordDelimit 
  1694. common punctuation 
  1695. mathematical operators.)
  1696. searchReplace txt,searchFor,replaceWith,
  1697.     runningTotal = 1
  1698.     totalChars=
  1699.     searchLen=
  1700.     replaceLen=
  1701. are legally adjacent
  1702. = " " & 
  1703. k& "-+*/<>,()[];^=&.?':" & 
  1704. curTxt 
  1705.         curOffset = 
  1706.             startPos = (
  1707.             endPos = (
  1708. -- test 
  1709. occurance 
  1710. isolated 
  1711. p- 1) \
  1712. + 1 \
  1713. -- change cursor 
  1714. resize 
  1715. entering
  1716. default 
  1717. leaving
  1718. handler resizes the 
  1719. splitter 
  1720. dragged
  1721. ZstartPos
  1722. X"user"
  1723. getsystemmetrics(
  1724. ( has swapped mouse buttons.
  1725. >23) >0
  1726. leftMouseButton 
  1727. width 
  1728. navigation 
  1729. minwidth 
  1730. maxwidth 
  1731. leftWindow 
  1732. rightWindow 
  1733. leftWindowWidth 
  1734. clientSize 
  1735. wholeWindowWidth 
  1736. clientsize 
  1737. leftMost 
  1738. minWidth
  1739. rightMost 
  1740. j(maxWidth,
  1741. splitterBounds 
  1742. DC's 
  1743. ;windows, since we'll be drawing 
  1744.     -- on 
  1745. hDCLeft 
  1746. getDC(clientHandle 
  1747. hDCright 
  1748. a pen
  1749. hPen 
  1750. createPen(0,2,0)
  1751. ! on 
  1752. ;DC's, storing old selected
  1753. hOldObjectleft 
  1754. selectObject(
  1755. hOldObjectMain 
  1756. modes 
  1757. oldROP2right 
  1758. setROP2(
  1759. oldROP2left 
  1760. windowRef 
  1761. curDC 
  1762. oldP 
  1763. mousePosition 
  1764. oldp <> 
  1765.             -- erase 
  1766. drawLine 
  1767. ,endPos
  1768. we need 
  1769. switch 
  1770. DC's, release them
  1771. deleteObject(
  1772. releaseDC(
  1773. hDCleft
  1774. RightBorder 
  1775. currentpage 
  1776. leftwindow 
  1777. syspageUnitsPerPixel
  1778. sizePage
  1779. -- draws a 
  1780. specified DC
  1781. endpos 
  1782. fromPoint 
  1783. PageUnitsToClient(
  1784. toPoint 
  1785. moveTo(
  1786. lineTo(
  1787. -- walks 
  1788. . If they are scripted,
  1789. dialog box allowing users 
  1790. their scrips
  1791. buttonclick
  1792. Zretval
  1793. dlgPage 
  1794. "scriptChooserDialog"
  1795. (o) > 0 
  1796. currentobject
  1797. currentObject)>0
  1798. nameRef(
  1799. ) = 1
  1800. obref 
  1801. "scriptObjects" 
  1802. %modal
  1803. -- display "friendly 
  1804. obtype 
  1805. obname 
  1806. "hour"
  1807. "Minute"
  1808. "AMPM"
  1809. minute 
  1810. value
  1811. #+ 1) 
  1812. %"00"
  1813. %"00"
  1814.  < 0 
  1815.  > 59
  1816. outside range 0 
  1817. %"00"
  1818. k12) + 1
  1819. %"00"
  1820. %"00"
  1821.  < 1 
  1822.  > 12
  1823. &&"out 
  1824. %"00"
  1825. + 1) 
  1826. %"00"
  1827. %"00"
  1828.  < 0 
  1829.  > 59
  1830. %"00"
  1831. initialize
  1832. 4OBJECT newHotwordID
  1833. %"hh : 
  1834. j: sec 
  1835. 2475,346
  1836. Q>R6R6R
  1837. myTopic
  1838. itemOffset
  1839. prompt
  1840. categories
  1841. Choose categories for topic
  1842. categoryStruct
  1843. label
  1844. enterPage
  1845. itemOffset
  1846. categories
  1847. itemLoc
  1848. categoryStruct
  1849. categoryStruct
  1850. compileCategories
  1851. hotword
  1852. month
  1853. buttonup
  1854. .%,    #?
  1855. decrement
  1856. daysInMonth
  1857. is outside range 1 to
  1858. increment
  1859. decrement
  1860. month
  1861. increment
  1862. month
  1863. out of range 1 to 12
  1864. month
  1865. month
  1866. month
  1867. decrement
  1868. increment
  1869. out of range 00 to 99
  1870. month
  1871. mm / dd / yy
  1872. newHotwordID
  1873. initialize
  1874. 31,28,31,30,31,30,31,31,30,31,30,31
  1875. month
  1876. daysInMonth
  1877. hotword
  1878. newHotwordID
  1879. "hideControls
  1880. reader
  1881. displayBitsPerPixel
  1882. tb30win.dll
  1883. backcolor
  1884. categories
  1885. lighterBlue
  1886. getDC
  1887. releaseDC
  1888. Topics
  1889. numColors
  1890. darkerBlue
  1891. <All topics>
  1892. navigationBar
  1893. Tvpopulate
  1894. getDeviceCaps
  1895. moveTo
  1896. lineTo
  1897. setROP2
  1898. ,"TkNo
  1899. createPen
  1900. deleteObject
  1901. selectObject
  1902. enterApplication
  1903. CshowControls
  1904. author
  1905. 1,!J<Y
  1906. topics
  1907. CategoryButtons
  1908. Navigation
  1909. showControls
  1910. "hideControls
  1911. reader
  1912. topics
  1913. CategoryButtons
  1914. Navigation
  1915. hideControls
  1916. itemOffset
  1917. description and script,description and example,description only
  1918. pageID
  1919. categoryStruct
  1920. categoryStruct
  1921. destroy
  1922. .&,    "
  1923. subTopicName
  1924. description and script,description and example,description only
  1925. scrolling
  1926. explanation
  1927. label
  1928. enterPage
  1929. subTopicName
  1930. description and script,description and example,description only
  1931. label
  1932. topic
  1933. label
  1934. leavePage
  1935. extractName
  1936. extractID
  1937. ,%H.%
  1938. itemOffset
  1939. stripChar
  1940. }releaseDC
  1941. 4getDeviceCaps
  1942. getDC
  1943. retval
  1944. numColors
  1945. Q@darkerBlue
  1946. R@lighterBlue
  1947. bckgrnds
  1948. intro,description and script,description and example,description only
  1949. curBack
  1950. backColor
  1951. categoryStruct
  1952. showCategoryStruct
  1953. stbk_noSwap
  1954. |CtwoDquicksrt
  1955. twoDquicksort
  1956. stbk_noSwap
  1957. |CtwoDquicksrt
  1958. twoDquicksrt
  1959. HHupdateDropDownList
  1960. enterDropDown
  1961. <All topics>
  1962. categoryStruct
  1963. updateDropDownList
  1964. topics
  1965. <All topics>
  1966. Tvpopulate
  1967. categoryStruct
  1968. selectChange
  1969. leaveDropDown
  1970. .&,    #>
  1971. ,%H.%
  1972. .&,    #>
  1973. .&+    +
  1974. bckgrnds
  1975. extractID
  1976. tb30dlg.dll
  1977. intro,description and script,description and example,description only
  1978. pageRef
  1979. wsortTextLines
  1980. sortTextLines
  1981. backRef
  1982. label
  1983. populate
  1984. extractID
  1985. buttonclick
  1986. 0,31,59,90,120,151,181,212,243,273,304,334
  1987. m,d,y
  1988. isLeapYear
  1989. Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
  1990. m/d/y
  1991. weekDay
  1992. ,!JdY
  1993. FALSE
  1994. isLeapYear
  1995. stbk_noSwap
  1996. |CtwoDquicksrt
  1997. twoDquicksort
  1998. stbk_noSwap
  1999. |CtwoDquicksrt
  2000. twoDquicksrt
  2001. false
  2002. wordDelimit
  2003. curTxt
  2004. -+*/<>,()[];^=&.?':
  2005. searchReplace
  2006. resize
  2007. mouseEnter
  2008. default
  2009. mouseLeave
  2010. selectObject
  2011. curDC
  2012. deleteObject
  2013. splitterBounds
  2014. endPos
  2015. getDC
  2016. hDCright
  2017. createPen
  2018. }releaseDC
  2019. splitter
  2020. hOldObjectleft
  2021. getsystemmetrics
  2022. leftWindow
  2023. oldROP2left
  2024. minwidth
  2025. rightWindow
  2026. gsizePage
  2027. -setROP2
  2028. getsystemmetrics
  2029. oldROP2right
  2030. windowRef
  2031. hOldObjectMain
  2032. hDCLeft
  2033. edrawLine
  2034. leftMost
  2035. maxwidth
  2036. wholeWindowWidth
  2037. rightMost
  2038. RightBorder
  2039. buttondown
  2040. lineTo
  2041. fromPoint
  2042. y!moveTo
  2043. toPoint
  2044. drawLine
  2045. obref
  2046. dlgPage
  2047. -nameRef
  2048. scriptObjects
  2049. scriptChooserDialog
  2050. group,field
  2051. currentobject
  2052. buttonclick
  2053. obtype
  2054. obname
  2055. nameRef
  2056. hotword
  2057. seconds
  2058. Minute
  2059. buttonup
  2060. decrement
  2061. minute
  2062. increment
  2063. is outside range 0 to 59
  2064. minute
  2065. minute
  2066. minute
  2067. minute
  2068. decrement
  2069. increment
  2070. out of range 1 to 12
  2071. decrement
  2072. out of range 00 to 59
  2073. ;seconds
  2074. increment
  2075. seconds
  2076. seconds
  2077. seconds
  2078. seconds
  2079. hh : min : sec AMPM
  2080. seconds
  2081. minute
  2082. newHotwordID
  2083. initialize
  2084. hotword
  2085. newHotwordID
  2086. Check for State Abbreviation
  2087. origPage
  2088. original
  2089. Check for State Abbreviation
  2090. label
  2091. Check for State Abbreviationi
  2092. This function tests a string to determine if it contains a valid U.S. state abbreviation.
  2093. Handler:  isState (<state>)
  2094. Parameters:
  2095. <state>: the string to check
  2096. Returns true if state is a valid abbreviation, false if not.
  2097.    true    string is a valid state abbreviation
  2098.    false    string is not a valid state abbreviationnnnnnnnnn
  2099. to get isState stateToCheck
  2100.     --The bars serve as item separators and to ensure that 
  2101.     --string is correct length, in this case two characters.
  2102.     get "|" & stateToCheck & "|"
  2103.     if it is in "|AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|"&\
  2104.      "IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|"&\
  2105.      "NY|NC|ND|OH|OK|" & \
  2106.      "OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|" 
  2107.         return true
  2108.     else
  2109.         return false
  2110. scriptChooserDialog
  2111. .&+    +
  2112. scriptObjects
  2113. enterpage
  2114. cancel
  2115. keychar
  2116. scriptObjects
  2117. cancel
  2118. selectedtextlines 
  2119. "scriptObjects" 
  2120. keyEnter
  2121. editscript 
  2122.     close 
  2123. origPage
  2124. original
  2125. scriptChooserDialog
  2126. label
  2127. &View the Selected Script:
  2128. bottomLine
  2129. topLine
  2130. scriptObjects
  2131. editScript
  2132. buttondoubleclick
  2133. editScript
  2134. selectedTextLines 
  2135.         -- the full 
  2136. {reference 
  2137. hiding 
  2138.         -- 
  2139. each 
  2140. 9,t)+1 
  2141. U(t) 
  2142. Button "integerUp"    Button id 2 of Page id 139
  2143. Button "integerDown"    Button id 3 of Page id 139
  2144. Group "dateButtons"    Group id 11 of Page id 139
  2145. Field "date"    Field id 13 of Page id 139
  2146. Group "timeButtons"    Group id 22 of Page id 139
  2147. Field "Time"    Field id 24 of Page id 139ld id 23 of Page id 139
  2148. Field "Time"    Field id 24 of Page id 139
  2149. buttonclick
  2150. buttonclick
  2151. View Script
  2152. cancel
  2153. buttonclick
  2154. buttonclick
  2155. Cancel
  2156. .&+    +
  2157. categories
  2158. categoryStruct
  2159. enterPage
  2160. ,%H.%
  2161. extractName
  2162. frefText
  2163. extractID
  2164. categories
  2165. stwoDQuickSort
  2166. categoryStruct
  2167. updateCategories
  2168. categories 
  2169. the "
  2170. ZmainStruct[][]
  2171. categoryStruct 
  2172. fref 
  2173. arraySize 
  2174. dimensions(
  2175. ni][1] 
  2176. i][2] 
  2177. selectedTextlines 
  2178. -- recreates structure 
  2179. updateCategories
  2180. frefText 
  2181. i][1] 
  2182. extractName(t)
  2183. i][2] 
  2184. extractID(t)
  2185. twoDQuickSort 
  2186. origPage
  2187. original
  2188. label
  2189. bottomLine
  2190. topLine
  2191. Categories
  2192. Arrays    150,127,126
  2193. Calling Windows Functions    133,113,112
  2194. Conversion help    128
  2195. Data Validation    76,74,28
  2196. Date functions    137,136,135,134
  2197. DDE    78,103,77
  2198. Debugging    126
  2199. DOS Utilities    85,83
  2200. File Maintenance    82
  2201. Navigation    149,91
  2202. Sorting and Searching    150,127,130,82,109
  2203. String Manipulation    132,131,130,129
  2204. Useful Functions    132,129,115
  2205. Widgets    141,140,139,140,139
  2206. Untitled    bel    ts    15
  2207. Useful Objects    
  2208. Useful Objects    95,96
  2209. Date functions    
  2210. cancel
  2211. categories
  2212. Untitled
  2213. Enter new category
  2214. buttonclick
  2215. -- prompts 
  2216. qcategory
  2217. buttonclick
  2218. ("Enter 
  2219. f"Untitled"
  2220. "categories" 
  2221. &New...
  2222. ,%H.%
  2223. cancel
  2224. extractName
  2225. frefText
  2226. You already have another topic with this name.
  2227. false
  2228. categories
  2229. Enter new name for this category.
  2230. found
  2231. buttonclick
  2232. -- allows user 
  2233. rename a category
  2234. buttonclick
  2235. fref 
  2236. "categories"
  2237. frefText 
  2238. selectedTextLines 
  2239. tabLoc 
  2240. ("Enter 
  2241. tabloc-1 
  2242. found 
  2243.             -- 
  2244. asure 
  2245. xalready used.
  2246. i <> 
  2247. extractName(
  2248. "You 
  2249. rhave another 
  2250.         -- update 
  2251. &Rename...
  2252. w,    #>
  2253. Cancel
  2254. extractName
  2255. Delete category
  2256. categories
  2257. buttonclick
  2258. a category
  2259. buttonclick
  2260. fref 
  2261. "categories"
  2262. selectedTextlines 
  2263. "Delete 
  2264. n" && 
  2265. & extractName(t) & 
  2266. & "?" 
  2267. f"OK" 
  2268. "Cancel"
  2269. &Delete
  2270. updateCategories
  2271. buttonclick
  2272. buttonclick
  2273. updateCategories
  2274.     close 
  2275. buttonclick
  2276. -- closes dialog box
  2277. buttonclick
  2278. &Cancel
  2279. Modify the selected category.
  2280. .&+    +
  2281. categories
  2282. .          
  2283. MS Sans Serif
  2284. Mammals
  2285. House Pets
  2286. Smell Bad
  2287. categories
  2288. 4,5,0
  2289. 4,5,0
  2290. 4,6,7,0
  2291. 4,5,0
  2292. Farm Animals
  2293. Household Pets
  2294. Stinky Animals
  2295. categoryStruct
  2296. topicsPerCategory
  2297. Data Valadation
  2298. 10,9,4,5,6,0,7
  2299. 13,12,11
  2300. DOS Utilities
  2301. File Maintenance
  2302. 16,15,14
  2303. Functions
  2304. Menus
  2305. Navigation
  2306. Programming Aids
  2307. Resources
  2308. Sorting and Searching
  2309. Useful Objects
  2310. Courier New
  2311. g"g#%~k
  2312. V-g"[
  2313. Data Valadation
  2314. 76,75,80,74,71,28,73,72
  2315. 78,79,103,77
  2316. DOS Utilities
  2317. 84,85,81,83,86
  2318. File Maintenance
  2319. 100,82,99
  2320. Functions
  2321. 108,88,87
  2322. Menus
  2323. Navigation
  2324. Programming Aids
  2325. 98,106,97
  2326. Resources
  2327. 92,94,93
  2328. Sorting and Searching
  2329. 82,107,109
  2330. Useful Objects
  2331. 95,96
  2332. MS Sans Serif
  2333. '&%~k
  2334. Arial
  2335. 6O*K~k
  2336. Courier New
  2337. 6O*K~k
  2338. Arial
  2339. Arial
  2340. Courier New
  2341. SubtopicName
  2342. script
  2343. SubtopicName
  2344. script
  2345. Menus
  2346. Navigation
  2347. Sorting and Searching
  2348. 130,82,109
  2349. String Manipulation
  2350. 132,131,130,129
  2351. Useful Functions
  2352. 132,129,115
  2353. Widgets
  2354. 141,140,139,138
  2355. Useful Objects
  2356. 95,96
  2357. MS Sans Serif
  2358. System
  2359.  Sans Serif
  2360. MS Sans Serif
  2361. Arial
  2362. r]g"=
  2363. Arial
  2364. r]g"=
  2365. Arial
  2366.  Sans Serif
  2367. Arrays
  2368. 150,127,126
  2369. Calling Windows Functions
  2370. 133,113,112
  2371. Conversion help
  2372. Data Validation
  2373. 76,74,28
  2374. Date functions
  2375. 137,136,135,134
  2376. 78,103,77
  2377. Debugging
  2378. DOS Utilities
  2379. 85,83
  2380. File Maintenance
  2381. Navigation
  2382. 149,91
  2383. Sorting and Searching
  2384. 150,127,130,82,109
  2385. String Manipulation
  2386. 132,131,130,129
  2387. Useful Functions
  2388. 132,129,115
  2389. Widgets
  2390. 141,140,139
  2391. Arrays
  2392. 150,127,126
  2393. Calling Windows Functions
  2394. 133,113,112
  2395. Conversion help
  2396. Data Validation
  2397. 76,74,28
  2398. Date functions
  2399. 137,136,135,134
  2400. 78,103,77
  2401. Debugging
  2402. DOS Utilities
  2403. 85,83
  2404. File Maintenance
  2405. Navigation
  2406. 149,91
  2407. Sorting and Searching
  2408. 150,127,130,82,109
  2409. String Manipulation
  2410. 132,131,130,129
  2411. Useful Functions
  2412. 132,129,115
  2413. Widgets
  2414. 141,140,139
  2415. Untitled
  2416. 0,139
  2417. Page id 143
  2418. D array"
  2419. navigationBar
  2420. Page id 1
  2421. categoryPicker
  2422. Page id 3
  2423. categoryMaintenance
  2424. Page id 8
  2425. Category Maintenance
  2426. newTopic
  2427. Page id 121
  2428. New Topic
  2429. scriptChooserDialog
  2430. OpenScript Library
  2431. Topic Categories
  2432. description and script
  2433. tline
  2434. SubtopicName
  2435. level
  2436. reader
  2437. author
  2438. false
  2439. author
  2440. enterpage
  2441. notifybefore 
  2442. in,ms
  2443. ThreeDeeRect
  2444. bottomLine
  2445. topLine
  2446. script
  2447. false
  2448. keydown
  2449. .&,    "
  2450. script
  2451. scrolling
  2452. rectangle
  2453. enterpage
  2454. key,isShift,isCtrl
  2455. caretLocation
  2456. notifyBefore 
  2457. fref 
  2458. txtOver 
  2459. 8= 0 
  2460. Script:
  2461. script
  2462. buttonclick
  2463. -- puts the contents 
  2464. lipboard
  2465. buttonclick
  2466. fref 
  2467. Copy Script
  2468. in,ms
  2469. ThreeDeeRect
  2470. bottomLine
  2471. topLine
  2472. explanation
  2473. .&,    "
  2474. scrolling
  2475. rectangle
  2476. explanation
  2477. enterpage
  2478. notifyBefore 
  2479. fref 
  2480. "explanation" 
  2481. txtOver 
  2482. 8= 0 
  2483. enterpage
  2484. reader
  2485. author
  2486. Check for Alpha Non-Numeric Data
  2487. ButtonStillDown Page Navigation
  2488. Scrollbar Group Scripts
  2489. itemOffset()
  2490. &File
  2491. &Open...    Ctrl+O
  2492. &Save    Ctrl+S
  2493. Save &As...
  2494. saveas
  2495. &Run...
  2496. E&xit    Alt+F4
  2497. &Edit
  2498. &Undo    Ctrl+Z
  2499. Cu&t    Ctrl+X
  2500. &Copy    Ctrl+C
  2501. &Paste    Ctrl+V
  2502. paste
  2503. A&uthor    F3
  2504. author
  2505. &Help
  2506. &Contents    F1
  2507. index
  2508. Navigation
  2509. rightBounds
  2510. sizeStuff
  2511. splitter
  2512. sizePage
  2513. sizePage
  2514. xpix 
  2515. sysPageUnitsPerPixel
  2516. rightBounds 
  2517. B"splitter" 
  2518. "sizeStuff" 
  2519. -- keep 
  2520. focuswindow 
  2521. origPage
  2522. original
  2523. Navigation
  2524. label
  2525. Choose a category:
  2526. Topics of this category:::
  2527. sizeStuff
  2528. categories
  2529. <All topics>ion Functions
  2530. <All topics>
  2531. Arrays
  2532. Calling Windows Functions
  2533. Conversion help
  2534. Data Validation
  2535. Date functions
  2536. Debugging
  2537. DOS Utilities
  2538. File Maintenance
  2539. Navigation
  2540. Sorting and Searching
  2541. String Manipulation
  2542. Useful Functions
  2543. WidgetsWidgetsObjectsful Objectsns
  2544. Useful Objects
  2545. navButtons
  2546. .&+    +
  2547. extractID
  2548. topics
  2549. tcount
  2550. buttonclick
  2551. buttonclick
  2552. fref 
  2553. asure 
  2554. isn't empty
  2555. tcount 
  2556. selectedTextLines 
  2557. beginning
  2558.         -- 
  2559.         -- navigate
  2560. extractID(
  2561. , so focuswindow reverts 
  2562. previous
  2563. .&+    +
  2564. extractID
  2565. topics
  2566. buttonclick
  2567. -- navigates 
  2568. buttonclick
  2569. fref 
  2570. asure there 
  2571. selectedTextLines 
  2572. going 
  2573.         -- 
  2574.         -- 
  2575. extractID(
  2576. y, so focusWindow reverts 
  2577. search
  2578. ,%H.%
  2579. cancel
  2580. bckgrnds
  2581. description and script,description and example,description only
  2582. searchPhrase
  2583. <Custom search>
  2584. No instances of
  2585. categories
  2586. found.
  2587. topics
  2588. Enter key word to search for.
  2589. explanation
  2590. backRef
  2591. Tvpopulate
  2592. buttonclick
  2593. buttonclick
  2594. Zfoundlist
  2595. ("Enter key 
  2596. searchPhrase 
  2597. ZallTopics
  2598. bckgrnds 
  2599. "description 
  2600. example,
  2601. only"
  2602. backRef 
  2603. pref 
  2604. "explanation" 
  2605. ) = 0
  2606. "No instances 
  2607. " && 
  2608. populate 
  2609. combobox "categories" 
  2610. "<Custom 
  2611. topics
  2612. <Introduction>    145
  2613. Add number of days to date    136
  2614. Auto-scroll field    141
  2615. Binary Insertion of Textline    109
  2616. Bring ToolBook Window to Front    77
  2617. Bring up the Command Window    103
  2618. ButtonStillDown Page Navigation    91
  2619. Changing the behavior of BACK    149
  2620. Check for Alpha Non-Numeric Data    28
  2621. Check for State Abbreviation    74
  2622. Convert textlines to list    132
  2623. Converting to Binary, Hex, Octal    128
  2624. Display 2-D array values    126
  2625. Dragging Objects    151
  2626. Exit and restart windows    133
  2627. Get Current Path Setting    83
  2628. Get day of week from date    134
  2629. Get Free Disk Space on a Drive    85
  2630. Get number of days in month    137
  2631. Initialize Excel Conversation    78
  2632. Insert/Overwrite field    140
  2633. isLeapYear()    135
  2634. itemOffset()    115
  2635. Limit Length of Entry String    76
  2636. Remove given char from string    129
  2637. Remove trailing spaces    131
  2638. Search and replace in a string    130
  2639. Search Path for File    82
  2640. Sorting a 1-D array    150
  2641. Sorting a 2-D array    127
  2642. Spin controls    139
  2643. Using a RECT structure    113
  2644. Using windows pointers    112s pointers    11213
  2645. Using windows pointers    112
  2646. categoryButtons
  2647. CategorySetup
  2648. categoryPicker
  2649. buttonclick
  2650. buttonclick
  2651. "categoryPicker" 
  2652. %modal
  2653. Topic Categories
  2654. CategoryMaintenance
  2655. categoryMaintenance
  2656. buttonclick
  2657. buttonclick
  2658. "categoryMaintenance" 
  2659. %modal
  2660. Category Maintenance
  2661. newTopic
  2662. buttonup
  2663. newTopic 
  2664. %modal
  2665. &New topic
  2666. w,    #>
  2667. .&,    "
  2668. Cancel
  2669. categories
  2670. Cannot delete the last page of this background.
  2671. label
  2672. Delete topic
  2673. buttonclick
  2674. buttonclick
  2675. "Delete 
  2676. M" && 
  2677. & label 
  2678. & "?" 
  2679. f"OK" 
  2680. "Cancel"
  2681. "Cannot delete the 
  2682. selectchange 
  2683. combobox "categories" 
  2684. &Delete topic
  2685. splitter
  2686. origPage
  2687. original
  2688. label
  2689. origPage
  2690. original
  2691. label
  2692. bottomLine
  2693. topLine
  2694. categories
  2695. Arrays
  2696. Calling Windows Functions
  2697. Conversion help
  2698. Data Valadation
  2699. Date functions
  2700. Debugging
  2701. DOS Utilities
  2702. File Maintenance
  2703. Navigation
  2704. Sorting and Searching
  2705. String Manipulation
  2706. Useful Functions
  2707. WidgetsWidgetsObjectsful Objectsns
  2708. Useful Objects
  2709. prompt
  2710. Choose categories for topic """et Free Disk Space on a Drive""
  2711. compileCategories
  2712. buttonclick
  2713. buttonclick
  2714. compileCategories
  2715.     close 
  2716. buttonclick
  2717. -- dismiss dialog box
  2718. buttonclick
  2719.     close 
  2720. &Cancel
  2721. ck(WORD)
  2722. to get getWinPointe
  2723. Scripts examples in library.tbk.
  2724. Scripts examples in library.tbk. Page 
  2725. numTabs 
  2726.     sls = 
  2727. valid parameter
  2728. "Must have 
  2729. )least 1 
  2730. "Can only 
  2731. 2" && 
  2732.  && "
  2733.         -- cache 
  2734. {reference 
  2735. optimization.
  2736. 9"&i) 
  2737. i <= 
  2738.             -- 
  2739. hidden 
  2740. %they've 
  2741. xbeen
  2742.             -- receiving them 
  2743. # are 
  2744. "manual" 
  2745. myNumTabs 
  2746. mynumtabs 
  2747. resized 
  2748. Notice 
  2749. -- methodSent: 
  2750. used 
  2751. differentiate 
  2752. =messages
  2753. ToolBook 
  2754. explicitly 
  2755.     ssm = syssuspendmessages
  2756.  off toolbooks 
  2757. messaging, 
  2758. %we will be changing
  2759. stuff.
  2760. Without 
  2761. recursively
  2762.     -- calls itself over 
  2763. Icon Resources
  2764.